//
//  EpointCheckUpdateTask.m
//  EpointFrame5
//
//  Created by 李亚春 on 13-12-16.
//  Copyright (c) 2013年 Epoint. All rights reserved.
//

#import "EpointCheckUpdateTask.h"
#import "HttpUtil.h"
#import "EpointStringUtil.h"
#import "TKAlertCenter.h"

@implementation EpointCheckUpdateTask

-(void)execute
{
    NSString *url = NSLocalizedString(@"Epoint_MobileManager_URL", @"");
//    "deviceType" = "2";//1手机 2平板
    NSString *deviceType =NSLocalizedString(@"deviceType", @"");
    url = [url stringByReplacingOccurrencesOfString:@"services/MobileOaManage?wsdl" withString:@"mobileconfig/updateclient"];
    NSString *update_url;
    if ([@"1" isEqualToString:deviceType]) {
        update_url =  [NSString stringWithFormat:@"%@/update_iphone.xml",url];
    }else if([@"2" isEqualToString:deviceType]){
        update_url =  [NSString stringWithFormat:@"%@/update_ipad.xml",url];
    }
   
    NSString *bs = [HttpUtil getStr:update_url];
    [self sendDataRefreshUI:bs];
    
}

@end
